public class Originator {

    private String currentName;
    private int currentNo;



    private String currentPhone;

    public Originator() {
    }

    public Originator(String name, int no,String phone) {

        this.currentName = name;
        this.currentNo = no;
        this.currentPhone=phone;
    }

    public Memento createMemento(){
        return new Memento(this);
    }

    public boolean restoreStateByMemento(Memento memento){
        this.currentName = memento.getNameState();
        this.currentNo = memento.getNoState();
        this.currentPhone=memento.getPhoneState();
        return true;

    }


    public String getCurrentName() {
        return currentName;
    }

    public void setCurrentName(String currentName) {
        this.currentName = currentName;
    }

    public int getCurrentNo() {
        return currentNo;
    }

    public void setCurrentNo(int currentNo) {
        this.currentNo = currentNo;
    }

    @Override
    public String toString() {
        return "门店:"+this.currentName+"街道:"+this.currentNo+"电话:"+this.currentPhone;
    }

    public String getCurrentPhone() {
        return currentPhone;
    }
    public void setCurrentPhone(String currentPhone) {
        this.currentPhone = currentPhone;
    }
}
